package a05demo5;

import java.io.File;

public class Test2 {
    public static void main(String[] args) {
        //D:\vscode\JavaScript
        File f = new File("D:\\vscode\\JavaScript");
        long len = getLine(f);
        System.out.println(len);
    }

    public static long getLine(File src) {
        long len = 0;
        File[] files = src.listFiles();
        for (File file : files) {
            if (file.isFile()) {
                len = len + file.length();
            } else {
                len = len + getLine(file);
            }
        }
        return len;
    }
}
